package com.yequan.work;

/**
 * @author yequan
 * @date 2021/04/12 20:39
 **/
public class PosDemo {

    public static void main(String[] args) {
        String pois = "[(116.48730,40.00290),(117.01730,40.00290),20210413063700],[(116.48729,40.00285),(117.00729,40.00285),20210413063700],[(116.47494899999992,40.024749067802695),(117.16998,39.164265)],[7]";
        double ride1Slng = 0;
        double ride1Slat = 0;
        double ride1Elng = 0;
        double ride1Elat = 0;
        double ride2Slng = 0;
        double ride2Slat = 0;
        double ride2Elng = 0;
        double ride2Elat = 0;
        long ride1PST = 0;
        long ride2PST = 0;
        double driverSlng = 0;
        double driverSlat = 0;
        double driverElng = 0;
        double driverElat = 0;
        int interCityType=7;

        //参数解析
        String[] split = pois.split(",");
        for (int i = 0; i < split.length; i++) {
            split[i] = split[i].replaceAll("[^\\d.]+", "");
        }
        System.out.println(split.length);
        ride1Slng = Double.parseDouble(split[0]);
        ride1Slat = Double.parseDouble(split[1]);
        ride1Elng = Double.parseDouble(split[2]);
        ride1Elat = Double.parseDouble(split[3]);
        ride2Slng = Double.parseDouble(split[5]);
        ride2Slat = Double.parseDouble(split[6]);
        ride2Elng = Double.parseDouble(split[7]);
        ride2Elat = Double.parseDouble(split[8]);
        ride1PST = Long.parseLong(split[4]);
        ride2PST = Long.parseLong(split[9]);
        driverSlng = Double.parseDouble(split[10]);
        driverSlat = Double.parseDouble(split[11]);
        driverElng = Double.parseDouble(split[12]);
        driverElat = Double.parseDouble(split[13]);
        interCityType=Integer.parseInt(split[14]);
    }
}
